import { CoolController, BaseController } from '@cool-midway/core';
import { Body, Get, Inject, Post, Query } from '@midwayjs/core';
import { BizWorkerIntroduceEntity } from '../../entity/introduce';
import { BizWorkerIntroduceService } from '../../service/introduce';

/**
 * 介绍内容
 */
@CoolController({
  api: ['add', 'delete', 'update', 'info', 'list', 'page'],
  entity: BizWorkerIntroduceEntity,
  service: BizWorkerIntroduceService,
  pageQueryOp: {
    fieldEq: ['workerId'],
    keyWordLikeFields: [],
  },
})
export class BizWorkerIntroduceController extends BaseController {
  @Inject()
  bizWorkerIntroduceService: BizWorkerIntroduceService;

  @Get('/getIntroduce', { summary: '获取师傅富文本介绍' })
  async getIntroduce(@Query('workerId') workerId) {
    return this.ok(await this.bizWorkerIntroduceService.getIntroduce(workerId));
  }
}
